/*
 * $Author: isan.wong@gmail.com $
 * $Date $
 * $Rev: 13 $
 * $URL: http://capitalbio-smd.googlecode.com/svn/src/com/capitalbio/smd/base/SymbolData.java $
 */

package com.capitalbio.smd.base;

import org.biojava.bio.symbol.Symbol;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class SymbolData {
	
	protected Log log = LogFactory.getLog(this.getClass());
	
	private Symbol symbol;
	private Symbol basecall;
	private String label;
	private int[] callbox;
	private int index;

	public SymbolData(Symbol basecall) {
		this.basecall = basecall;
		setSymbol(basecall);
	}
	
	public SymbolData(Symbol basecall, int[] callbox, int index) {
		this.basecall = basecall;
		setSymbol(basecall);
		this.callbox = callbox;
		this.index = index;
	}

	public Symbol getSymbol() {
		return symbol;
	}
	
	/**
	 * 恢复 symbol 的原始值 (basecall)
	 */
	public void setSymbolWithBaseCall() {
		setSymbol(basecall);
	}
	
	public void setSymbol(Symbol symbol) {
		this.symbol = symbol;
	}

	public int[] getCallbox() {
		return callbox;
	}

	public void setCallbox(int[] callbox) {
		this.callbox = callbox;
	}

	public String toString() {
		if (label == null) {
			label = Util.getSymbolLabel(symbol);
		}
		return label;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

}
